<!DOCUMENTTYPE html>
<html>
<head>
	<title>千秋戏 - 开发版</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="height=device-height,
                      width=device-width, initial-scale=1.0,
                      minimum-scale=1.0, maximum-scale=1.0,
                      user-scalable=no">
  <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico"/>
	<link rel="stylesheet" type="text/css" href="segmented-controls.css">
	<link rel="stylesheet" type="text/css" href="main.css">
	<link rel="stylesheet" type="text/css" href="decks.css">
	<link rel="stylesheet" type="text/css" href="notifications.css">
	<link rel="stylesheet" type="text/css" href="tableinfo.css">
</head>

<div class="appcontainer noselect">
	<div class="appwrapper">
	<div id="configurator" class="flexbox transitopacity">
	  <div id="btn_autotest" style="background-color:#66f; display:none" onclick="AUTOTEST_autostartmatch()">自动测试</div>

		<div id="modeinput" class="segmented-control" style="width: 100%; color: #334422">
			<input type="radio" name="gamemode" id="vs_ai"     checked onclick='SetGameMode(1);'>
			<input type="radio" name="gamemode" id="vs_player" onclick='SetGameMode(2);'>
			<label for="vs_ai"     data-value="独享的快乐">单人游戏</label>
			<label for="vs_player" data-value="双倍的快乐">双人对战</label>
		</div>

		<div id="packselect_info">
		</div>

		<div id="packinput" class="segmented-control" style="width: 100%; color: #281B11">
			<input type="radio" name="version" id="p12" onclick='SetPack([1,2]);'>
			<input type="radio" name="version" id="p13" onclick='SetPack([1,3]);'>
			<input type="radio" name="version" id="p23" onclick='SetPack([2,3]);'>
			<label for="p12" data-value="1+2 代人物">1+2</label>
			<label for="p13" data-value="1+3 代人物">1+3</label>
			<label for="p23" data-value="2+3 代人物">2+3</label>
		</div>

		<div id="voiceinput" class="segmented-control" style="width: 50%; color: #281B11">
			<input type="radio" name="voice" id="voiceon">
			<input type="radio" name="voice" id="voiceoff">
			<label for="voiceon" data-value="完成组合时播放语音">语音</label>
			<label for="voiceoff" data-value="完成组合时BlueBlue">无语音</label>
		</div>

		<div id="randomspinput" class="segmented-control" style="width: 50%; color: #281B11">
			<input type="radio" name="randomsp" id="randomspon" onclick="SetRandomSp('randomspon');">
			<input type="radio" name="randomsp" id="randomspoff" onclick="SetRandomSp('randomspoff');">
			<label for="randomspon" data-value="系统随机发放特殊牌">随机特殊牌</label>
			<label for="randomspoff" data-value="使用自己拥有的特殊牌">自带特殊牌</label>
		</div>

		<div id="aiinput" class="segmented-control" style="width: 100%; color: #281B11">
			<input type="radio" name="ai" id="ai1">
			<input type="radio" name="ai" id="ai2">
			<input type="radio" name="ai" id="ai3" >
			<label for="ai1" data-value="温和亲切的AI">炤级AI</label>
			<label for="ai2" data-value="沉迷种田的AI">洛级AI</label>
			<label for="ai3" data-value="恶意满满的AI">危级AI</label>
		</div>
		<div id="spinput" class="segmented-control" style="width: 100%; color: #281B11">
			<input type="radio" name="sp" id="sp0">
			<input type="radio" name="sp" id="sp1">
			<input type="radio" name="sp" id="sp2">
			<input type="radio" name="sp" id="sp3">
			<label for="sp0" data-value="AI不想使用珍稀牌">AI无珍稀牌</label>
			<label for="sp1" data-value="AI珍稀牌量是你一半">AI 1/2珍稀牌</label>
			<label for="sp2" data-value="AI珍稀牌量和你一样">AI等量珍稀牌</label>
			<label for="sp3" data-value="AI拥有所有珍稀牌">AI全珍稀牌</label>
		</div>
		<div id="comfirmSetting" class="confirmbutton">确认此设置</div>
		<div id="multiplayerinfo" style="width:100%; color:#112211; border: 1px #112211 solid; height: 16vw; font-size:2vw;">
      <div id="avatar_and_nickname" style="width:50%; float:left;">

        <div style="height: 6vw">
          <div id="avatar_nickname_hint" style="text-align:center;float:left;clear:both;">点击修改头像与昵称<br/>连线之后就不能改了</div>
          <div id="curr_avatar" class="avatarpreview glow" style="background-image: url('avatars/avatar1.png'); float:left; clear:left;" onclick="ShowAvatarSelectionMenu();"></div>
          <div style="height: 6vw; margin-left: 0.5vw; vertical-align:middle; float:left;">
            <div id="nickname_disp" style="margin-top:1.5vw; font-size:2vw; display:block"
              onclick="StartEditingNickname();">名字在这</div>
          </div>
        </div> <!-- End of 头像设置 -->
      </div>
      <div style="width:50%; float: left">
        <!-- 连线前 -->
        <div id="serverselect" class="segmented-control" style="width: 100%; color: #334422; opacity:1; display:none">
            <input type="radio" name="servername" id="servername1" disabled="true">
            <input type="radio" name="servername" id="servername2" checked>
            <!--<input type="radio" name="servername" id="servername3" disabled="true">-->
            <label for="servername1" data-value="测试用服务器">不要打雷</label>
            <label for="servername2" data-value="默认服务器">苏酥甜心糕</label>
            <!--<label for="servername3" data-value="不怕打雷" disabled>二号服务器</label>-->
          </div>
        <div id="connect_to_server" style="width:100%; height:6vw; line-height:6vw; background-color: #112211; color:#fff;" onclick='ConnectToServer();'>
          [决定好了，连线]
        </div>
        <div id="reconnect" style="width:100%; height:5vw; background-color: #112211; display:none;">
          <div style="margin-top:1.5vw; color:#fff" onclick='ReShowConnect();'>[重新尝试]</div>
        </div>

        <!-- 连线后 -->
        <!-- 当前服务器信息 -->
        <div style="height:3vw; width:100%">
          <div id="lobbystatus" style="float:left;"></div>
          <div id="myplayerid" style="float:right; margin-right:1vw"></div>
          <div style="clear:both;"></div>
          <div id="refresh_lobbystatus" style="width:100%; display: none">
            [刷新]
          </div>
        </div>

        <!-- 开始多人游戏 -->
        <div id="multiplayerButtons" style="width:100%; display: none">
          <div id="opponent_avatar_name" style="display:none">
            <div style="height: 6vw">
              <div id="oppo_avatar" class="avatarpreview glow" style="background-image: url('avatars/avatar1.png'); float:left; clear:left;"></div>
              <div style="height: 6vw; margin-left: 0.5vw; vertical-align:middle; float:left;">
                <div id="oppo_nickname" style="margin-top:1.5vw; font-size:2vw; display:block">对手的名字
                </div>
              </div>
            </div>
          </div>
          <div id="match_buttons" style="margin-bottom: 0.5vw; margin-top: 0.5vw">
            <div id="find_opponent" class="multiplayerbutton" onclick="ShowOpponentFinderMenu();">查找玩家</div>
            <div id="start_match" class="multiplayerbutton">随机匹配</div>
          </div>
          <div id="confirm_cancel_buttons" style="width:100%; margin-bottom: 0.5vw; margin-top: 0.5vw">
            <div id="confirm_match" class="multiplayerbutton" style="background-color:#66CC66;display:none">确认</div>
            <div id="cancel_match" class="multiplayerbutton" style="background-color:#CC6666;display:none">放弃</div>
            <div style="clear: both; width:100%;"></div>
            <div style="display:none;background-color:#6666CC;" onclick='AUTOTEST_autostartmatch();'>放 弃 治 疗</div>
          </div>
        </div>

      </div>
      <div style="clear:both; width:100%;"></div>
      <div>&nbsp;</div>
		</div>

		<!--<div style="width:100%" id="footer">-->
			<!--<br/>-->
			<!--原版以及原作者主页：-->
			<!--<br/>-->
			<!--<a style="color:#281b11" href="https://bubububaoshe.github.io/">https://bubububaoshe.github.io/</a> | <a style="color:#281b11" href="https://github.com/bubububaoshe/bubububaoshe.github.io">[github]</a></div>-->
			<!--<br/>-->
			<!--<div><a onclick="ShowUpdateInfo();" style="color:#281b11" href="#">更新记录</a></div>-->
	</div>
	<div id="spselection" class="transitopacity">
		<div class="selectionarea verticalflex">
			<div>
				<div id="sprepo" class="charinfocontainer flexbox"></div>
				<div class="cover"></div>
			</div>
			<div>
				<div id="sppick" class="charinfocontainer flexbox"></div>
			</div>
		</div>
		<div class="rightsidebar verticalflex">
			<div></div>
			<div id="selectioninfo" class="centeredtext"><div>从上方牌库<br />选择特殊牌<br />到下方牌组<br />最多选15张</div></div>
			<div id="gamestart" class="centeredtext button"><div>开始<br />游戏</div></div>
		</div>
	</div>

	<div id="avatarselection" class="configurator_popup_window">
		<div style="width: 60%; margin-left: 20%; background-color: #281B11; height: 40vw;  border: 1px #EEE solid;">
		头像选择<br/>
			<div class="backbutton" onclick="CloseAvatarSelectionMenu();"></div>
			<span style="color: #999; font-size:1.3vw;">头像的选择不会影响游戏流程。</span>
			<div style="overflow-y: scroll;
			            font-size: 1.5vw; height:34vw" id="avatar_choices">
        <!--
        <div class="avatarsmallwrapper">
          <div class="avatarpreview glow" style="background-image:url('avatars/avatar1.png'); margin-left:1vw"></div>
          <div>鼎剑峰</div>
        </div>
        <div class="avatarsmallwrapper">
          <div class="avatarpreview" style="background-image:url('avatars/avatar2.png'); margin-left:1vw"></div>
          <div>百草谷</div>
        </div>
        <div class="avatarsmallwrapper">
          <div class="avatarpreview" style="background-image:url('avatars/avatar3.png'); margin-left:1vw"></div>
          <div>补天岭隘口</div>
        </div>
        -->
			</div>
		</div>
	</div>

	<div id="nicknameinputwindow" class="configurator_popup_window" style="top:10%">
		<div style="width: 60%; margin-left: 20%;
		            background-color: #281B11; height: 40vw;
								font-size: 2vw; min-height:48pt;
								border: 1px #EEE solid;">
			<div style="height:2vw;color:#777766">请输入昵称：</div>
			<input id="nickname_input" style="margin-top: 2vw; margin-left: auto; margin-right: auto; font-size:2vw; display:none"
				type="text" size=10 onkeypress="NicknameInputKeypressEvent(event);"
				blur="EndEditingNickname();"></input>
			<div id="nickname_input_done" onclick="EndEditingNickname();"
			     style="display:none;width:12vw; height:3vw; margin-top: 1vw; margin-left:auto; margin-right:auto; background-color:#566555;color:#aa917f;">按此确认</div>
		</div>
	</div>

<!--	<div id="updateinfowindow" class="configurator_popup_window">-->
<!--		<div style="width: 60%; margin-left: 20%; padding:2vw;-->
<!--		            background-color: #281B11; height: 40vw;-->
<!--								font-size: 1.5vw;-->
<!--								border: 1px #EEE solid;">-->
<!--			<div id="updateinfo_content" style="text-align:left;">-->
<!--				<div>-->
<!--		    （似乎还没有更新信息。）-->
<!--				</div>-->
<!--			</div>-->
<!--			<div style="width:20vw; height:3vw; background-color:#aa917f;-->
<!--			            background-color:#566555; margin-top:1vw; margin-left:auto;-->
<!--									margin-right:auto; text-align:center;"-->
<!--			  onclick="FetchUpdateInfo(0);">-->
<!--				查看全部更新记录-->
<!--			</div>-->
<!--			<div style="width:12vw; height:3vw; background-color:#aa917f;-->
<!--			            background-color:#566555; margin-top:1vw; margin-left:auto;-->
<!--									margin-right:auto; text-align:center;"-->
<!--			  onclick="HideUpdateInfo();">-->
<!--				关闭-->
<!--			</div>-->
<!--		</div>-->
<!--	</div>-->

  <div id="opponentfinder" class="configurator_popup_window">
    <div style="width: 60%; margin-left: 20%;
		            background-color: #281B11; height: 40vw;
								border: 1px #EEE solid;">
		  <div style="height:6vw">
			  <div>查找玩家</div>
			  <div style="color: #999; font-size: 1.3vw;">可以输入昵称的一部分或临时ID来查找</div>
		  </div>
      <div style="position:absolute; left:20%; top:0;"> <!-- Top Row -->
        <div onclick="CloseOpponentFinderMenu();"
				     style="width:4vw; height:4vw;
						        background-size:100% 100%;
										background-image:url('avatars/back.png');
										float:left;">
				</div>
        <div style="float:left;">
          <div style="width:7vw;
					            float:left; text-align: center;
											margin-left:0.2vw; margin-top: 0.5vw;">
            <div id="oppofind_my_avatar" class="avatarpreview_small glow"
						style="background-image:url('avatars/avatar1.png');
						       margin-left:1vw;
									 margin-top:0.5vw;">
						</div>
          </div>
          <div style="float:left;
					            text-align:left;
											margin-top:1vw">
            <div id="oppofind_my_nickname" style="font-size:1.5vw"></div>
            <div id="oppofind_my_playerid" style="font-size:1.5vw"></div>
          </div>
        </div>
      </div>
      <div style="clear:both;width:100%;"></div>
      <hr/>

      <div id="room_buttons" style="margin-bottom: 0.5vw; margin-top: 0.5vw; font-size:2vw">
        <div id="inviteinput" class="inviteinput" style="float:left;">
        ID或昵称：
				<input id="invitedid" type="text" size=10
				  style="border:1px #ccc solid;
					       background-color:#333333;
								 color:#EEE;
								 margin-right:0.5vw; height:3vw;
								 font-size:2vw;"></input>
        </div>
        <div id="invitebutton" style="width:8vw; height:3.5vw; float:left; background-color:#442">
        查找
        </div>
        <div id="find_opponent_info" style="float:left;">如果什么都不输入，就会随机返回一些结果，嘿嘿</div>
        <div style="clear:both;"></div>

        <div id="opponentsearchresult" style="overflow-y:scroll;">
          <!--
          <div class="avatarsmallwrapper">
            <div class="avatarpreview glow" style="background-image:url('avatars/avatar1.png'); margin-left:1vw"></div>
            <div>呱呱呱</div>
          </div>
          <div class="avatarsmallwrapper">
            <div class="avatarpreview" style="background-image:url('avatars/avatar2.png'); margin-left:1vw"></div>
            <div>喵喵喵</div>
          </div>
          <div class="avatarsmallwrapper">
            <div class="avatarpreview" style="background-image:url('avatars/avatar3.png'); margin-left:1vw"></div>
            <div>汪汪汪</div>
          </div>
          -->
        </div>
      </div>
    </div>
  </div>

  <div id="continuedialog" style="font-size: 2vw; display:none; transition:height 0.7s; overflow:hidden; height:0px;">
    <div style="color:#7a614f">还继续玩吗？</div>
    <div style="color:#999">只有双方都选“继续玩”才会新开一局，不然就返回主菜单啦。</div>
    <div style="width:24vw; margin-left:auto; margin-right:auto;">
      <div id="vote_play_again" class='continue_dialog_button' onclick="VotePlayAgain();">
      继续玩
      </div>
      <div id="vote_not_play_again" class='continue_dialog_button' onclick="VoteNotPlayAgain();">
      不玩了
      </div>
      <div style="clear:both; width:100%;"></div>
    </div>
    <div id="vote_playagain_msg" style="color:#EEE;width:100%";></div>
  </div>

	<div id="restore_snapshot_dialog" style="font-size: 2vw; display:none; transition:height 0.7s; overflow:hidden; height:0px;">
		<div style="color:#EEE">是否恢复之前的游戏？</div>
		<div style="color:#aa9976" id="restore_dialog_info"></div>
		<div style="width:24vw; margin-left:auto; margin-right:auto;">
      <div id="restore_snapshot_yes" class='continue_dialog_button' onclick="RestoreSnapshotButtonClicked(true);">
      是
      </div>
      <div id="restore_snapshot_no" class='continue_dialog_button' onclick="RestoreSnapshotButtonClicked(false);">
      否
      </div>
      <div style="clear:both; width:100%;"></div>
    </div>
	</div>

	<div id="main">
		<div id="scoreboard">
			<div id="table0" class="cardstack"></div>
			<div id="score0" class="bignotice">
				<div>0</div>
				<div class="combobonus">
				</div>
			</div>
			<div id="infobox" class="centeredtext bignotice"><div></div></div>
			<div id="score1" class="bignotice">
				<div>0</div>
				<div class="combobonus"></div>
			</div>
			<div id="table1" class="cardstack"></div>
		</div>
		<div id="gamezonecontainer">
			<div id="gamezone">
				<div id="hand0container"><div id="hand0"></div></div>
				<div id="poolcontainer">
					<div id="pool"></div>
					<div id="repository"></div>
				</div>
				<div id="hand1container"><div id="hand1"></div></div>
				<div id="blocker" class="cover"></div>
				<div id="finalcontainer" class="cover">
					<div class="badge revolver">
						<div></div><div></div><div></div><div></div>
					</div>
					<div id="reconfig" class="button centeredtext">
						<div id="reconfig_caption">重新设置</div>
					</div>
					<div id= "restart" class="button centeredtext">
						<div id="finalmsg" class="bignotice"></div>
						<div class="bannertext">再来亿局</div>
					</div>
					<div class="string"></div>
				</div>
				<div class="tableinfocontainer cover transitopacity">
					<div class="charinfocontainer flexbox"></div>
					<div class="charinfocontainer flexbox"></div>
				</div>
			</div>
			<div class="tableinfocontainer cover transitopacity">
				<div class="infoheader bignotice">
						<div>&#10057; 对方卡牌</div>
						<div>&#10057; 完成组合</div>
						<div>&#10057; 未完组合</div>
				</div>
				<div class="charinfocontainer flexbox"></div>
				<div class="ccomboinfocontainer flexbox"></div>
				<div class="icomboinfocontainer flexbox"></div>
			</div>
			<div class="tableinfocontainer cover transitopacity">
				<div class="infoheader bignotice">
						<div>&#10057; 我方卡牌</div>
						<div>&#10057; 完成组合</div>
						<div>&#10057; 未完组合</div>
				</div>
				<div class="charinfocontainer flexbox"></div>
				<div class="ccomboinfocontainer flexbox"><!--
					<div class="combocard">
						<div>
							<div class="thumbnailcard" style="background-Image:url('img/oysg1.jpg')"></div>
						</div>
						<div>
							<div id="combocardinfo">
								<div>老板</div>
								<div>90</div>
							</div>
							<div id="combocardchars">
								<span class="notmine">欧阳少恭</span><span class="ismine">沈夜</span>
							</div>
						</div>
					</div>-->
				</div>
				<div class="icomboinfocontainer flexbox"></div>
			</div>
			<div class="tableinfocontainer cover">
				<div class="infoheader bignotice">
						<div>&#10057; 我方珍稀牌</div>
				</div>
				<div class="charinfocontainer specials flexbox"></div>
			</div>
		</div>
		<div id="specialboard">
			<div id="specials0" class="cardstack"></div>
			<div id="hoverinfobox" class="bignotice"></div>
			<div id="avatarboxes" class="bignotice"
			     style="position:absolute;
					        padding:0;
									margin:0;
									z-index:0;
									height:20vw;
									width:100%;
									transition: opacity 0.3s;">
					<div id="avatarbox0" style="height:8vw;position:absolute;top:0;">
						<div style="width:7vw;
						            float:left; text-align: center;
												margin-left:0.2vw; margin-top: 0.5vw;">
	            <div id="avatarbox0_avatar" class="avatarpreview"
							style="background-image:url('');
							       margin-left:1vw;
										 margin-top:0.5vw;">
							</div>
	          </div>
	          <div style="float:left; text-align:left;
												margin-top:1vw; width:9vw; height:6vw;
												align-items:center; display:flex;">
							<!-- https://stackoverflow.com/questions/8865458/how-do-i-vertically-center-text-with-css -->
	            <div id="avatarbox0_nickname" style="font-size:1.5vw"></div>
	          </div>
					</div>
					<div id="avatarbox1" style="height:8vw;position:absolute;bottom:0;">
						<div style="width:7vw;
												float:left; text-align: center;
												margin-left:0.2vw; margin-top: 0.5vw;">
							<div id="avatarbox1_avatar" class="avatarpreview"
							style="background-image:url('');
										 margin-left:1vw;
										 margin-top:0.5vw;">
							</div>
						</div>
						<div style="float:left; text-align:left;
												margin-top:1vw; width:9vw; height:6vw;
												align-items:center; display:flex;">
							<div id="avatarbox1_nickname" style="font-size:1.5vw"></div>
						</div>
					</div>
			</div>
			<div id="specials1" class="cardstack"></div>
		</div>
	</div>
	<div id="infobanner" class="cover transitopacity banner">
		<div>
			<div class="bannertext">
				<span></span><span class="bannerhl"></span><span></span><span class="bannerhl"></span><span></span>
			</div>
			<div class="bannercards"><!--
				<div class="swapposter">
				<div></div>
					<div class="postercard"></div>
				</div>
				<div class="swapposter">
					<div></div>
					<div class="postercard" style="background-image:url(img/wz3.jpg)"></div>
				</div>-->
			</div>
		</div>
	</div>

	<div id="avatarselection_blocker" style="position:absolute; top:0; left:0; width:100%; height:100%; background-color:#EBE6DF; opacity:0.6; z-index:99; display:none"></div>
	<div id="offensive_wait_msg" style="width:100%;position:absolute;top:50%;z-index:100;display:none;">
	  <div style="width:40vw;margin-left:auto;margin-right:auto;
		            background-color:#281B11;border:1px #FFF solid;
								z-index:100;color:#EEE;font-size:2vw;", id="wait_msg_content">
	  请等待另一名玩家选择完特殊牌
	  </div>
	</div>
	<div id="genericdialog" style="width:100%;position:absolute;top:50%;
	                               z-index:100;display:none;background-color:#281B11;
																 border:1px #FFF solid;color:#EEE;">
		<div id="genericdialog_title" style="color:#7a614f">标题</div>
		<div id="genericdialog_content" style="margin-left:auto; margin-right:auto;"></div>
	</div>

	<audio id="soundeffect" src=""></audio>
</div>
</div>
</body>
</html>
<script type="text/javascript">
  var g_server_url = 'https://qianqiuxi.sususweet.ltd';
  var my_server_url = 'http://localhost:3000';
</script>
<!--<script src="http://edgeofmap.com/qqxupd/1000autumns.js"></script>-->

<script type="text/javascript">
  // GLOBAL VARIABLES!
  var is_using_localstore = false;
	var g_resource_prefix = "";
	var g_version_id = 1010;
	var g_update_url = "http://edgeofmap.com/qqxupd/index.php"
	//var g_update_url = "http://localhost/qqxupd/index.php";

  //
	function IsDebug() {
	  var h = window.location.href;
		if (h.indexOf('http://localhost') == 0) return true;
	  else return false;
	}

	function IsResourceLocal() {
		var h = window.location.href;
		if (h.indexOf('file://') == 0) return true;
		else if (h.indexOf('http://localhost') == 0) return true;
		else return false;
	}

	function IsInCordova() {
		var h = window.location.href;
		if (h.indexOf('file://') == 0) return true;
		else return false;
	}

	function ShowSomething() {
		var f = document.getElementById('footer');
		var blah = "Cookie=" + document.cookie;
		blah = blah + ", localStorage.length=" + localStorage.length;
		f.textContent = blah;
	}

	function EnableDebugSwitches() {
		document.getElementById('serverselect').style.display="block";
		document.getElementById('servername1').disabled = null;
		document.getElementById('servername1').click();
		BONUS_THRESHOLDS = [170/2, 140/2, 110/2];

		var f = document.getElementById('footer');
		f.addEventListener("click", function() {
			ShowSomething();
		});
	}

	var configurator_click_count2 = 0;
	var configurator_click_count1 = 0;
	function Debug1Clicked() {
		if (document.getElementById('configurator').style.visibility == "visible") {
			configurator_click_count1 += 1;
			if (configurator_click_count1 == 10) {
				EnableDebugSwitches();
			}
		}
	}
	function Debug2Clicked() {
		if (document.getElementById('configurator').style.visibility == "visible") {
			configurator_click_count2 += 1;
			if (configurator_click_count2 == 10) {
				setCookie("nickname", "haha!");
				localStorage.setItem('localStorageTest', 1);
			}
		}
	}

	//ShowSomething();

	{
		var is_dbg = IsDebug();

		if (is_dbg) {
			EnableDebugSwitches();
			is_using_localstore = true;
			//g_update_url = "http://localhost/qqxupd/index.php";
			console.log("[DBG] Will use localstore");
		}

		if (IsInCordova()) {
			is_using_localstore = true;
		}
	}

	{
		var c = document.getElementById('vs_player');
		c.addEventListener('click', Debug1Clicked);
	      c = document.getElementById('vs_ai');
		c.addEventListener('click', Debug2Clicked);
	}

	{
		var is_loc = IsResourceLocal();
	  if (is_loc) {
			console.log("Resources are will be fetched from local");
			var x=document.getElementsByClassName('appwrapper');
			if (x.length > 0) {
				x = x[0];
				x.style.backgroundImage = "url('img/background.jpg')";
			}
			g_resource_prefix = "";
	  } else {
			console.log("Resources will be fetched from remote");
	    g_resource_prefix = "";
	  }
	}
</script>
<script src="cookieAndLocalStore.js"></script>
<script src="tricks.js"></script>
<script src="model.js"></script>
<script src="controller.js"></script>
<script src="spmanager.js"></script>
<script src="tableinfoview.js"></script>
<script src="view.js"></script>
<script src="avatar.js"></script>
<script src="socket.io/socket.io.js"></script>
<script src="versus-client.js"></script>
<script type="text/javascript">

// FetchUpdateInfo(g_version_id);

</script>
